package top.zackyoung.bbs.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import top.zackyoung.bbs.entity.Focus;
import top.zackyoung.bbs.entity.Pagination;

import java.util.List;

@Mapper
@Repository
public interface FocusMapper {
    // 查询关注
    List<Focus> queryFocus(Integer id);

    // 获取粉丝数
    int queryFaceNum(@Param("id") Integer id, @Param("username") String username);

    // 删除关注列表
    int deleteFocus(Integer id);

    // 添加关注
    int insetFocus(@Param("userId") Integer userId, @Param("type") String type, @Param("username") String username);

    // 查询关注数
    int queryFocusNum(@Param("username") String username);

    // 查询用户是否关注了该对象
    int queryIsFocus(@Param("userId") Integer userId, @Param("type") String type, @Param("focusObjectId") Integer focusObjectId);

    //我的关注
    List<Focus> queryFocusObject(Pagination page);
}